package com.gec.yhzh.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.yhzh.entity.Vaccine;
import com.gec.yhzh.mapper.VaccineMapper;
import com.gec.yhzh.service.IVaccineService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 疫苗 服务实现类
 * </p>
 *
 * @author jerry
 * @since 2025-03-10
 */
@Service
public class VaccineServiceImpl extends ServiceImpl<VaccineMapper, Vaccine> implements IVaccineService {
@Autowired
VaccineMapper vaccineMapper;
    public IPage<Vaccine> getVaccineList(IPage<Vaccine> page) {
        return baseMapper.selectPage(page, null);
    }

    @Override
    public List<Vaccine> listAll() {
        return vaccineMapper.listAll();
    }


    public boolean saveVaccine(Vaccine vaccine) {
        return saveOrUpdate(vaccine);
    }

    public boolean deleteVaccineById(Integer id) {
        return removeById(id);
    }
}
